package org.example.spring;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

/**
 * User: ZhangJuntao
 * Date: 13-10-29
 * Time: 上午11:16
 */
public class MessageEventListener implements ApplicationListener {

  @Override
  public void onApplicationEvent(ApplicationEvent event) {
    if (event instanceof MessageEvent) {
      MessageEvent msEvent = (MessageEvent) event;
      System.out.println("Received: " + msEvent.getMessage());
    }
  }
}
